//
//  YQPPPageView.h
//  项目基础框架
//
//  Created by yangqian on 16/3/11.
//  Copyright © 2016年 NetEase-yangqian. All rights reserved.
//

#import <Foundation/Foundation.h>

@class YQPPPageView;

@protocol YQPPPageViewDataSource <NSObject>
- (NSInteger)numberOfPages: (YQPPPageView *)pageView;
- (UIView *)pageView: (YQPPPageView *)pageView viewInPage: (NSInteger)index;
@end

@protocol YQPPPageViewDelegate <NSObject>
@optional
- (void)pageViewScrollEnd: (YQPPPageView *)pageView
             currentIndex: (NSInteger)index
               totolPages: (NSInteger)pages;

- (void)pageViewDidScroll: (YQPPPageView *)pageView;
- (BOOL)needScrollAnimation;
@end

@interface YQPPPageView : UIView<UIScrollViewDelegate>

@property (nonatomic,strong)    UIScrollView   *scrollView;
@property (nonatomic,weak)    id<YQPPPageViewDataSource>  dataSource;
@property (nonatomic,weak)    id<YQPPPageViewDelegate>    pageViewDelegate;
- (void)scrollToPage: (NSInteger)pages;
- (void)reloadData;
- (UIView *)viewAtIndex: (NSInteger)index;
- (NSInteger)currentPage;


//旋转相关方法,这两个方法必须配对调用,否则会有问题
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                                duration:(NSTimeInterval)duration;

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                                         duration:(NSTimeInterval)duration;



@end
